package cn.idanda.web.base;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 首页控制器
 * @author rain
 * @since 2015年9月13日 下午4:40:02
 */
@Controller
@RequestMapping("main")
public class MainController {
	/** 日志实例 */  
    private static final Logger logger = Logger.getLogger(MainController.class);  
    @RequestMapping(value = "/index")
    @ResponseBody
    public String index() {
        return "/index.html";
    }

    @RequestMapping(value = "/welcome")
    public String welcome() {
        return "/main/welcome";
    }
    
    @RequestMapping(value="hello",method = RequestMethod.GET)  
 //   @ResponseBody
    public String printWelcome(ModelMap model) {
    	System.out.println("hello!");
        model.addAttribute("message", "Spring 3 MVC Hello World");  
        return "base/template";
    }  

}
